package cn.tedu.spring.resource;

import cn.tedu.spring.config.SpringConfig;
import cn.tedu.spring.resource.controller.ReController;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestResource {
    @Test
    public void Test(){
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        ReController controller = context.getBean("reController", ReController.class);
        controller.cont();
    }

    @Test
    public void configTest(){
        ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);
        ReController controller = context.getBean(ReController.class);
        controller.cont();
    }
}
